import os
import time

from py.handler.msg_handler_abc import MsgHandlerAbc
from py.storage.SettingUtil import setting
from py.uitls import CamUtil, CamUtilProcess


class MsgHandlerCam(MsgHandlerAbc):
    def handle(self, title, content):
        pic_name = time.strftime('%Y%m%d%H%M%S', time.localtime(time.time()))
        pic_name = os.path.join(setting.file_path, pic_name + '.jpg')
        CamUtilProcess.get_pic_join(pic_name)
        title = '拍照成功！'
        return title, None, pic_name
